package com.example.controller;

import com.demo.utils.ResponseResult;
import com.demo.utils.ResultUtils;
import com.example.dto.ArticleDto;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/article")
public class ArticleController {

    @GetMapping("/list")
    public ResponseResult list(){
        return ResultUtils.success();
    }


    @GetMapping("/{id}")
    public ResponseResult read(@PathVariable Long id){
        ArticleDto dto = new ArticleDto();
        dto.setAuthor("admin");
        return ResultUtils.success(dto);
    }


}
